package com.project.restaurant.thirdpart.mail;




import com.fasterxml.jackson.annotation.JsonIgnore;
import com.project.restaurant.thirdpart.bo.template.MailTemplateGenerator;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@Accessors(chain = true)
public class TemplateMail extends Mail{
    @JsonIgnore
    private MailTemplateGenerator template;

    public TemplateMail(String to, String subject, MailTemplateGenerator template){
        super(to,subject,template.generateTemplate());
        this.template = template;
    }
    public TemplateMail setTemplate(MailTemplateGenerator template){
        this.setContent(template.generateTemplate());
        this.template = template;
        return this;
    }
}
